hotplug: ignore xenstore-read error
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 16 Feb 2010 09:28:39 +0000 (09:28 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 16 Feb 2010 09:28:39 +0000 (09:28 +0000)
The failure to read "backend/tap/<domid>/*" in the xenstore is a usual
case since the domain is gone after xenstore-ls command is executed.
The error should be ignored.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
tools/hotplug/Linux/blktap
tools/hotplug/Linux/block

index 01a0f6c6daa6ead44ba42adcb96743410a53494e..eb2e8b19416200e9a216261ca16c9394729d6b46 100644 (file)
@@ -23,7 +23,7 @@ check_blktap_sharing()
     do
         for dev in $(xenstore-list "$base_path/$dom")
         do
-            params=$(xenstore_read "$base_path/$dom/$dev/params" | cut -d: -f2)
+            params=$(xenstore_read_default "$base_path/$dom/$dev/params" "" | cut -d: -f2)
             if [ "$file" = "$params" ]
             then
 
@@ -35,7 +35,7 @@ check_blktap_sharing()
                         return
                     fi
                 else 
-                    local m=$(xenstore_read "$base_path/$dom/$dev/mode")
+                    local m=$(xenstore_read_default "$base_path/$dom/$dev/mode" "")
                     m=$(canonicalise_mode "$m")
 
                     if [ "$m" = 'w' ] 
index f22a1946495a9c1fb241f4ced520e1fad104f1b6..ff85bcb43350c34b972be7b6ee0e7fb9dcd91ec0 100644 (file)
@@ -100,7 +100,7 @@ check_sharing()
             return
           fi
         else
-          local m=$(xenstore_read "$base_path/$dom/$dev/mode")
+          local m=$(xenstore_read_default "$base_path/$dom/$dev/mode" "")
           m=$(canonicalise_mode "$m")
 
           if [ "$m" = 'w' ]